package com.example01;

public class BubbleSortTest {
    public static void main(String[] args) {
        test();
    }
    private static void test() {
        int i;
        int j;
        int t;
        int[] arr = {8,3,4,22,1};
        for(i = 0; i < arr.length - 1; i++) {
            for(j = i + 1; j < arr.length ; j++ ) {
                if(arr[i] > arr[j]) {
                    t = arr[i];  arr[i] = arr[j];  arr[j] = t;
                }
            }
        }
        for(int i1: arr) {
            System.out.println(i1);
        }
    }
}